<div class="clear"></div>
<!-- Start Menu -->
    <div class="Menu">
		<ul id="menu-menu" class="catmenu">
			<?php if ($cates) foreach ($cates as $cate) {
				echo '<li id="menu-item-',$cate->cat_id,'" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-',$cate->cat_id,' "><a href="',category_url($cate->cat_code),'" class="',$cate->cat_icon,'">',$cate->cat_name,'</a></li>';
			} //end of foreach cates ?>
		</ul>
		<span id="nav-button-more" class="button"><a href="#" rel="nofollow">Xem tất cả</a></span>
		<div class="clear"></div>
    </div>
    <div class="clear"></div>
    <div style="display: none;" id="more-navigation"> 
        <section id="game-categories">
            <h2>Danh mục game</h2>
            <ul id="menu-footermenu" class="menu">
<?php
$cat_tree = $this->scache->script('module.category.footmenu.get_cat_tree_array','$this->mcategory->get_cat_tree_array(1);');


	if ($cat_tree) foreach ($cat_tree as $cat) {
		if (!$cat || !isset($cat['parent']->cat_id)) 
		continue;
		
		echo '<li id="menu-item-'.$cat['parent']->cat_id.'" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-'.$cat['parent']->cat_id.'"><a href="'.category_url($cat['parent']->cat_code).'">'.$cat['parent']->cat_name.'</a>';
		if (isset($cat['child']) && $cat['child']) {
			echo '<ul class="sub-menu">';
			foreach ($cat['child'] as $child) {
				echo '<li id="menu-item-'.$child->cat_id.'" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-'.$child->cat_id.'"><a href="'.category_url($child->cat_code).'">'.$child->cat_name.'</a></li>';
			}
			echo '</ul>';
		}
		echo "</li>";
	}
?>
</ul>            
            </section>
        <div class="clear"></div>
    </div>
    <!-- End Menu --> 
<script type="text/javascript">
$(function (){
	$('#nav-button-more a').click(function (){
		if ($('#more-navigation').css('display') == 'none') {
			$('#more-navigation').slideDown();
		}else {
			$('#more-navigation').slideUp();
		}
		return false;
	});
});
</script>